package com.example.interfacecall.controller;

import com.alibaba.fastjson.JSONObject;
import com.example.interfacecall.domain.Book;
import com.example.interfacecall.domain.Result;
import com.example.interfacecall.util.HttpUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;

@Controller
public class BaohanapplyController {
    @Value("${interface.url}")
    private String interfaceurl;

    @RequestMapping(value = "/baohanapply")
    public String  myNearby(Model model)
    {
        return "1111";
    }

    //所调用的接口
    @RequestMapping(value = "/baohanapplycall", method = { RequestMethod.GET,RequestMethod.POST })
    @ResponseBody
    public Result baohanapply(HttpServletRequest request)throws Exception {
        String interfaceName = "baohanapply";
        String url = interfaceurl +"/"+ interfaceName;
        String s= HttpUtils.sendPost(url, "");
 //       return result;
        return null;
    }

}
